package com.situ.hibernate.entity;

import java.util.HashSet;
import java.util.Set;

public class User {
	private Integer id;
	private String name;
	private Integer age;
	private String password;
	private Department department;
	// 一个用户有多个角色
	private Set<Role> roles = new HashSet<>();

	public User() {
		super();
	}

	public User(String name, Integer age, String password) {
		super();
		this.name = name;
		this.age = age;
		this.password = password;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	public Set<Role> getRoles() {
		return roles;
	}

	public void setRoles(Set<Role> roles) {
		this.roles = roles;
	}

	@Override
	public String toString() {
		return "User [id=" + id + ", name=" + name + ", age=" + age + ", password=" + password + ", department="
				+ department + ", roles=" + roles + "]";
	}

}
